<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/crypto-js/3.1.9-1/crypto-js.min.js"></script>
    <script src="https://cdn2.yukisaki.io:51391/oj_cdn/jquery/jquery.min.js"></script>
</head>
<body>
    密码：
    <input type="text" id="key" value="">
    网址：
    <input type="text" id="url" value="">

    <button onclick="gen($('#key').val(), $('#url').val())"> 生成 </button>
    <br>

    <textarea id="result"></textarea>
</body>
<script src="key.js"></script>
<script>

    function gen(key, url) {
        //console.log(key)
        //console.log(url)
        var p1 = CryptoJS.HmacMD5(key, pwd);
        var p2 = CryptoJS.AES.encrypt(url, key);
        //console.log(p1);
        //console.log(p2);
        $('#result').val(p1 + "\n" + p2)
    }
</script>
</html>